import request from '@/config/axios'

// 证书信息 VO
export interface CertificateVO {
  id: number // 主键
  name: string // 证书名称
  imgUrl: string // 证书图片url
}

// 证书信息 API
export const CertificateApi = {
  // 查询证书信息分页
  getCertificatePage: async (params: any) => {
    return await request.get({ url: `/website/certificate/page`, params })
  },

  // 查询证书信息详情
  getCertificate: async (id: number) => {
    return await request.get({ url: `/website/certificate/get?id=` + id })
  },

  // 新增证书信息
  createCertificate: async (data: CertificateVO) => {
    return await request.post({ url: `/website/certificate/create`, data })
  },

  // 修改证书信息
  updateCertificate: async (data: CertificateVO) => {
    return await request.put({ url: `/website/certificate/update`, data })
  },

  // 删除证书信息
  deleteCertificate: async (id: number) => {
    return await request.delete({ url: `/website/certificate/delete?id=` + id })
  },

  // 导出证书信息 Excel
  exportCertificate: async (params) => {
    return await request.download({ url: `/website/certificate/export-excel`, params })
  },
}